package com.musifind.common;

import java.util.HashMap;

public class GlobalCache {
	
	public static HashMap<String, Object> globalValues;
	
	private static void getInstance()
	{
		if(globalValues==null)
			globalValues = new HashMap<String, Object>();
	}
	
	public static void addKey(String key, Object value){
		getInstance(); 
		if(!globalValues.containsKey(key))
			globalValues.put(key, value);
	}

	public static Object getValueByKey(String key){
		getInstance(); 
		Object value = null;
		if(globalValues.containsKey(key)){
			value = globalValues.get(key);
		}
		return value;
	}
	
}
